package com.kksoft.readcm.activity;

import java.util.HashMap;
import java.util.Iterator;

import android.os.AsyncTask;

import com.kksoft.readcm.a.Appconfig;
import com.kksoft.readcm.a.ItemAppObservable;
import com.kksoft.readcm.objects.n;

final class ListAsyncTask extends AsyncTask<Object, Object, Object>           //old a
{
	private int a;
    private final HashMap b;
    private final Appconfig pAppConfig;
    private ListViewActivity d;
    
    public ListAsyncTask(ListViewActivity listviewactivity, Appconfig af1, int i, HashMap hashmap)
    {
    	super();
        d = listviewactivity;
        
        pAppConfig = af1;
        a = i;
        b = hashmap;
    }

    protected final Object doInBackground(Object aobj[])
    {
    	java.util.Map.Entry entry;
    	if(b!=null)
    	{
    		Iterator iterator = b.entrySet().iterator();
    		while(iterator.hasNext())
    		{
    			entry = (java.util.Map.Entry)iterator.next();
                switch(a)
                {
                case 1: // '\001'
                    n n1 = d.k;
                    int i = ((Integer)entry.getKey()).intValue();
                    com.kksoft.readcm.objects.l l = n1.a(i);
                    d.readlistadapter.a(l);
                    int j = pAppConfig.getItemAppObservable().a(l, true, true, true);
                    break;

                case 2: // '\002'
                	ItemAppObservable e1 = pAppConfig.getItemAppObservable();
                    n n2 = d.k;
                    int k = ((Integer)entry.getKey()).intValue();
                    com.kksoft.readcm.objects.l l1 = n2.a(k);
                    e1.a(l1, true, true);
                    break;
                }
    		}
    		pAppConfig.getItemAppObservable().e();
            entry = null;
    	}
    	else
    		entry = null;
    	return entry;
    }

    protected final void onPostExecute(Object obj)
    {
        if(ListViewActivity.a(d) != null)
        {
            d.removeDialog(23);
            ListViewActivity.b(d);
        }
        d.b(false);
    }
}